import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { viteMockServe } from 'vite-plugin-mock'

// https://vitejs.dev/config/

export default defineConfig((command) => {
  return {
    plugins: [
      vue(),
      viteMockServe({
        supportTs:false,
        logger: false,
        mockPath: "./src/mock/"
      })
    ],
    resolve: {
      alias: {
        '@': path.resolve(__dirname, './src'),
      }
    },
    // 在服务器nginx部署 。比如域名是http://wenhuiweb.cn/vue3all/
    base: process.env.NODE_ENV === 'production' ? '/vue3all/' : '/'
  }
})
